/*
 * Licensed to Elasticsearch under one or more contributor
 * license agreements. See the NOTICE file distributed with
 * this work for additional information regarding copyright
 * ownership. Elasticsearch licenses this file to you under
 * the Apache License, Version 2.0 (the "License"); you may
 * not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */

package com.didi.arius.gateway.elasticsearch.client.response.cluster.updatesetting;

import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.annotation.JSONField;
import com.didi.arius.gateway.elasticsearch.client.response.ESAcknowledgedResponse;
import com.didi.arius.gateway.elasticsearch.client.utils.JsonUtils;

import java.util.Map;

/**
 * A response for a cluster update settings action.
 */
public class ESClusterUpdateSettingsResponse extends ESAcknowledgedResponse {
    @JSONField(name = "transient")
    private JSONObject transientObj;

    @JSONField(name = "persistent")
    private JSONObject persistentObj;

    public ESClusterUpdateSettingsResponse() {
        // pass
    }

    @JSONField(serialize=false)
    public Map<String, String> getFlatTransient() {
        return JsonUtils.flat(transientObj);
    }

    @JSONField(serialize=false)
    public Map<String, String> getFlatPersistent() {
        return JsonUtils.flat(persistentObj);
    }



    public JSONObject getTransientObj() {
        return transientObj;
    }

    public void setTransientObj(JSONObject transientObj) {
        this.transientObj = transientObj;
    }

    public JSONObject getPersistentObj() {
        return persistentObj;
    }

    public void setPersistentObj(JSONObject persistentObj) {
        this.persistentObj = persistentObj;
    }
}
